package com.demo.web.service.impl;

import com.demo.web.dao.ITestDao;
import com.demo.web.service.ITestServer;
import com.jweb.framework.db.annotation.Transaction;
import com.jweb.framework.ioc.annotation.Autowired;
import com.jweb.framework.ioc.annotation.Value;
import com.jweb.framework.mvc.annotation.Service;
import com.jweb.plugins.j2cache.annotation.Cacheable;

/**
 * 开启事务的基本服务
 * 
 * @author Yuanqy
 *
 */
@Service
public class TestServerImpl implements ITestServer {

	private @Value("testMsg") String msg;

	private @Autowired ITestDao dao;

	@Override
	@Cacheable//开启缓存
	@Transaction//开启事务
	public String getMsg() {
		return msg + dao.getNow();
	}
}
